﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Twisted
{
    class Tiro : Objeto3D
    {

        float velocidade = -0.5f;
        float angulo;
        float aceleracao = 0.01f;




        public Tiro(Model modelo, float angulo, float forca)
            : base(modelo)
        {
            this.escala.Z = 0.5f;
            this.escala.X = 0.5f;
            this.escala.Y = 0.5f;

            this.angulo = angulo;
            this.aceleracao += forca / 10000;
            this.escala.X += forca / 100;
            this.escala.Y += forca / 1000;
            this.escala.Z += forca / 1000;

        }

        public override void Update(GameTime gameTime)
        {

            this.posicao.Z -= (float)Math.Cos(MathHelper.ToRadians(-angulo)) * velocidade;
            this.posicao.X -= (float)Math.Sin(MathHelper.ToRadians(-angulo)) * velocidade;

            this.rotacao.Z += 4;

            velocidade += aceleracao;









        }

    }
}
